package collection.list;

import java.util.ArrayList;
import java.util.Iterator;

public class Test2 {

    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("1");
        list.add("1");
        list.add("1");
        list.add("1");
        Iterator<String> it = list.iterator();
//        while (it.hasNext()){
//            it.remove();
//        }
        System.out.println("=================");
        for (String s : list) {
            System.out.println(s);
        }
        System.out.println("=================");
        list.forEach(System.out::println);

        list.clear();
        list.add("虚鲲");
        list.add("巴黎剩母");

        list.add(1,"肌肉金轮");
        System.out.println(list);

        System.out.println(list.remove(0));
        System.out.println(list);

        System.out.println(list.remove("巴黎剩母"));
        System.out.println(list);

        System.out.println(list.set(0, "肉蛋葱🐓"));
        System.out.println(list);
    }

}

